package com.example.takeoff.exception;


import com.example.takeoff.common.Result;
import com.example.takeoff.common.constants;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ProjectExceptionAdvice
{
    @ExceptionHandler(ServiceException.class)
    @ResponseBody
    public static Result doException(ServiceException se)
    {
        se.printStackTrace();
        return Result.error(se.getCode(),se.getMessage());
    }
}
